From: Jim Blandy Date: Tue, 2 Mar 1993 07:22:33 +0000 (+0000) Subject: * etags.el (find-tag-other-window): If another window is already X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~97084 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=4969329862d4c89997a8c9b326660fa7d0a607b9;p=emacs.git * etags.el (find-tag-other-window): If another window is already displaying the tag's buffer, explicitly set that window's point to the tag's position. --- diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el index 1f97188c6d5..1cf1e810541 100644 --- a/lisp/progmodes/etags.el +++ b/lisp/progmodes/etags.el @@ -658,10 +658,17 @@ See documentation of variable `tags-file-name'." ;; windows. To prevent this, we save the selected window's point before ;; doing find-tag-noselect, and restore it after. (let* ((window-point (window-point (selected-window))) - (tagbuf (find-tag-noselect tagname next-p))) + (tagbuf (find-tag-noselect tagname next-p)) + (tagpoint (progn (set-buffer tagbuf) (point)))) (set-window-point (prog1 (selected-window) - (switch-to-buffer-other-window tagbuf)) + (switch-to-buffer-other-window tagbuf) + ;; We have to set this new window's point; it + ;; might already have been displaying a + ;; different portion of tagbuf, in which case + ;; switch-to-buffer-other-window doesn't set + ;; the window's point from the buffer. + (set-window-point (selected-window) tagpoint)) window-point))) ;;;###autoload (define-key ctl-x-4-map "." 'find-tag-other-window)